package android.coocoo.controller;

import java.util.ArrayList;

import android.app.NotificationManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.coocoo.common.Const;
import android.coocoo.models.TaskInfo;
import android.util.Log;

public class AlarmBroadcastReceiver extends BroadcastReceiver{

	ArrayList<TaskInfo> tasksList;
	
	@Override
	public void onReceive(Context context, Intent intent) {
		this.tasksList = intent.getParcelableArrayListExtra(Const.ExtraFlag.TASKS_LIST);
		if (this.tasksList == null)
			Log.e("alarmBroadcastReceiver", "tasksList is null");
		else if (this.tasksList.size() == 0)
			Log.e("alarmBroadcastReceiver", "tasksList.size() == 0");
		else{
			int i;
			remindHighestPriorityTask(this.tasksList.get(0));
			for (i=0; i<this.tasksList.size(); i++){
				notifyTask(this.tasksList.get(i));
			}
		}
	}

	private void notifyTask(TaskInfo taskInfo) {
		// TODO Auto-generated method stub
//		NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
	}

	private void remindHighestPriorityTask(TaskInfo taskInfo) {
		// TODO Auto-generated method stub
		
	}

}
